<?php

namespace App\Modules\Admin\Entities\Vip;

use App\Models\Model;

use App\Modules\Apibackstage\Entities\Users\UserModel;
use Illuminate\Database\Eloquent\Relations\HasOne;

class VipCardModel extends Model
{
    protected $table = 'vip_cards';
    protected $fillable = [
        'vip_id',
        'user_id',
        'number',
        'use_time'
    ];

    /**
     * @return HasOne
     */
    public function vip(): HasOne
    {
        return $this->hasOne(VipModel::class,'id','vip_id');
    }

    /**
     * @return HasOne
     */
    public function user(): HasOne
    {
        return $this->hasOne(UserModel::class,'id','user_id');
    }
}
